package com.itheima.controller;

import com.itheima.anno.Log;
import com.itheima.common.R;
import com.itheima.dto.EmpLoginDto;
import com.itheima.service.impl.EmpServiceImpl;
import com.itheima.vo.EmpLoginVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class LoginController {
    @Autowired
    private EmpServiceImpl empService;
    @PostMapping("/login")
    public R login(@RequestBody EmpLoginDto dto) {
        log.info("登录请求参数：{}", dto);
        EmpLoginVo login = empService.login(dto);
        return R.ok(login);
    }
}
